package com.sskj.app.controller;


import com.fegin.bean.app.StockUser;
import com.fegin.bean.common.ztree.ZtreeBean;
import com.sskj.app.service.StockUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * <p>
 * 手机用户表 前端控制器
 * </p>
 *
 * @author 张子艺
 * @since 2019-02-19
 */
@Controller
@RequestMapping("/app/stockUser")
public class StockUserController {
    @Autowired
    StockUserService stockUserService;
    /**
     * 用户登陆
     * @param account 账号
     * @param pswd 密码
     * @return
     */
    @RequestMapping(value = "/login")
    @ResponseBody
    public Map login(@RequestParam("account")String account, @RequestParam("pswd")String pswd) {
        return stockUserService.login(account,pswd);
    }
    /**
     * 新增用户或修改用户信息
     * @return
     */
    @RequestMapping(value = "/insertOrUpdate")
    @ResponseBody
    public Map insertOrUpdate(@RequestBody StockUser stockUser) {
       return   stockUserService.saveOrUpdateStockUser(stockUser) ;

    }

}
